<%--
  Created by IntelliJ IDEA.
  User: 骆鹏
  Date: 2017/7/25
  Time: 10:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="Java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <title>人员调度历史信息</title>
    <link rel="stylesheet" href="/css/officialDocument/officialDocument.css">
    <link rel="stylesheet" href="/lib/layer/skin/default/layer.css">
    <link rel="stylesheet" type="text/css" href="../lib/pagination/style/pagination.css"/>
    <link rel="stylesheet" href="/lib/laydate/need/laydate.css">
    <link rel="stylesheet" href="/css/base.css">
    <script src="/js/common/language.js"></script>
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
    <script src="/js/jquery/jquery.cookie.js"></script>
    <script src="/lib/layer/layer.js?20201106"></script>
    <script src="/js/base/base.js"></script>
    <script src="/lib/laydate/laydate.js"></script>
    <script type="text/javascript" src="/js/base/tablePage.js"></script>
    <script src="/lib/pagination/js/jquery.pagination.min.js" type="text/javascript" charset="utf-8"></script>
    <style>
        .big{
            font-size: 12pt;
            color: #124164;
            font-weight: bold;
        }
        .tableHeader {
            height: 30px;
            background: #ffffff;
            border-bottom: 1px #dddddd solid;
            border-top: 1px #dddddd solid;
            border-right: 1px #dddddd solid;
            font-weight: bold;
            color: #383838;
            line-height: 23px;
            padding-left: 5px;
        }
        .tableData {
            font-size: 9pt;
            background: #FFFFFF;
            border-bottom: 1px #dddddd solid;
            border-top: 1px #dddddd solid;
            border-right: 1px #dddddd solid;
            padding: 3px;
            height: 30px;
        }
    </style>
</head>
<body>
    <table align="center" class="tableBlock" style="width:80%;">
        <thead>
            <tr>
                <td colspan="8" class="big">人员调度详情<span style="font-size: 10pt;">( 红色为原岗位 , 绿色为调度后岗位 )</span></td>
            </tr>
            <tr>
                <td class="tableHeader">姓名</td>
                <td class="tableHeader">部门</td>
                <td class="tableHeader">职务</td>
                <td class="tableHeader">岗位</td>
                <td class="tableHeader">项目名称</td>
                <td class="tableHeader">所在位置</td>
                <td class="tableHeader">调度人</td>
                <td class="tableHeader">调度时间</td>
            </tr>
        </thead>
        <tbody>

        </tbody>
        <tfoot>

        </tfoot>
    </table>
</body>
<script type="text/javascript">
    $(function () {
        var url = window.location.href;
        var assessScore = url.substr(url.indexOf('=')+1);
        function isNull(data){
            if (data == ''||typeof(data) == 'undefined') {
                return '';
            }else if(data.indexOf(',') > 0){
                var i = data.indexOf(",");
                var oldObj = data.substr(0,i);
                var newObj = data.substr(i+1);
                return "<span style='color: red;'>"+oldObj + "</span> --> <span style='color: green;'>" + newObj + "</span>";
            }else {
                return data;
            }
        }
        $.ajax({
            url:'/hrPersonnelScheduling/selectHrDispatcherDetail',
            type:'get',
            data:{
                'assessScore': assessScore
            },
            dataType:'json',
            success:function (res) {
                var str = '';
                var data = res.obj;
                for (var i = 0; i < data.length; i++) {
                    str += '<tr>' +
                        '<td class="tableData">'+isNull(data[i]['userName'])+'</td>' +
                        '<td class="tableData">'+isNull(data[i]['deptName'])+'</td>' +
                        '<td class="tableData">'+isNull(data[i]['jobPositionName'])+'</td>' +
                        '<td class="tableData">'+isNull(data[i]['workJobName'])+'</td>' +
                        '<td class="tableData">'+isNull(data[i]['projectName'])+'</td>' +
                        '<td class="tableData">'+isNull(data[i]['locationAddressName'])+'</td>' +
                        '<td class="tableData">'+isNull(data[i]['createrName'])+'</td>' +
                        '<td class="tableData">'+isNull(data[i]['createrTime'])+'</td>' +
                        '</tr>';
                }
                $('tbody').html(str);
                console.log(res.obj.length);
            }
        });
    });
</script>
</html>